<?php
define('SYSPATH', dirname(dirname(__FILE__)).'/');
define('APPURL', str_replace($_SERVER['DOCUMENT_ROOT'],'',APPPATH));
require SYSPATH.'core/Project.php';
$project = new Project();
$project->init();
require APPPATH.'lib/common.php';
$sysdata = include APPDATA.'cnf/system.php';
if(ISADMIN==true) define('APPCONTROL', APPPATH.$sysdata['control_path'].'/');
define('APPTPL', APPPATH.$sysdata['tpl_path'].'/');
require SYSPATH.'core/Function.php';
if($sysdata['debug']==true){
	define('DEBUG', true); 
	error_reporting(0);
	ini_set('display_errors', 'off');
}else{
	define('DEBUG', false); 
	error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
	ini_set('display_errors', 'on');
}
$router = new Router();
$router->set_routes();
?>